package com.banyuan;

import com.banyuan.config.SpringConfig;
import com.banyuan.controller.AccountController;
import com.banyuan.domain.Account;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class SpringDemo1 {

    public static void main(String[] args) {

        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountController bean = ac.getBean(AccountController.class);
        List<Account> accountList = bean.selectAll();
        System.out.println(accountList);
    }
}
